﻿using Fantasy.Helper;
using Fantasy.Platform.Net;

//设置命令行参数
//使用配置文件的形式->Main->鼠标右键->Add->Configuration Files->launchSetting.json
//这样就能编辑项目的默认配置

string root = "../../../../../Config/Json/Server/";
var machineConfigText = await FileHelper.GetTextByRelativePath(root + "MachineConfigData.Json");
var processConfigText = await FileHelper.GetTextByRelativePath(root + "ProcessConfigData.Json");
var sceneConfigText = await FileHelper.GetTextByRelativePath(root + "SceneConfigData.Json");
var worldConfigText = await FileHelper.GetTextByRelativePath(root + "WorldConfigData.Json");

MachineConfigData.Initialize(machineConfigText);
ProcessConfigData.Initialize(processConfigText);
SceneConfigData.Initialize(sceneConfigText);
WorldConfigData.Initialize(worldConfigText);

// Fantasy.Log.Register(new Fantasy.Nlog);

//初始化框架，添加程序集到框架中
Fantasy.Platform.Net.Entry.Initialize(typeof(Entity.Entry).Assembly);

//启动Fantasy.Net
await Fantasy.Platform.Net.Entry.Start();
